package com.fdb.efp.nls.service.impl.daybat;

import com.fdb.basic.framework.core.base.FrameworkService;
import com.fdb.basic.framework.core.constant.BaseConstant;
import com.fdb.efp.nls.service.dao.BatBrhmDao;
import com.fdb.efp.nls.service.dao.SOrgDao;
import com.fdb.efp.nls.service.facade.BatBrhmService;
import com.fdb.efp.nls.service.facade.BatUpdateSOrgService;
import com.fdb.efp.nls.service.facade.PubSysInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * 更新机构信息操作服务
 *
 * @author Cytus_
 */
@Service("batUpdateSOrgService")
public class BatUpdateSOrgServiceImpl implements BatUpdateSOrgService, FrameworkService {

	private static Logger logger = LoggerFactory.getLogger(BatUpdateSOrgServiceImpl.class);

	@Autowired
	private SOrgDao sOrgDao;

	@Autowired
	private BatBrhmDao batBrhmDao;

	@Autowired
	private BatBrhmService batBrhmService;

	@Autowired
	private PubSysInfoService pubSysInfoService;

	// 下载到本地的服务器地址
	@Value("${ftp.localDownloadPath}")
	private String downloadPath;

	// 读取文件更新机构表信息
	@Override
	public void batUpdateSOrg() throws Exception {
		String openDay = pubSysInfoService.getLastOpenday(BaseConstant.SYS_ID_1001);
		openDay = openDay.replace("-", "");
		logger.info("开始进行机构信息更新的跑批任务......");
		int flg = 0;
		try {
			// 从服务器下载文件到本地服务器

		} catch (Exception e) {
			logger.error("更新机构信息发生错误");
			throw e;
		}
		logger.info("处理机构更新完成" + openDay);

	}

}
